package com.bckj.fastboot.core.extra.mongo.configuration;

import com.bckj.fastboot.core.extra.mongo.MongoOps;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.MongoOperations;

/**
 * MongoConfiguration
 *
 * @author wfc
 **/
@AutoConfiguration
@ConditionalOnClass(MongoOperations.class)
public class MongoConfiguration {

    @Bean
    public MongoOps mongoOps(MongoDatabaseFactory factory) {
        return new MongoOps(factory);
    }
}
